<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>会议室预定状态图</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css-v=3.3.5.css"
          tppabs="http://www.zi-han.net/theme/hplus/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="css/font-awesome.min.css-v=4.4.0.css"
          tppabs="http://www.zi-han.net/theme/hplus/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <link href="css/plugins/iCheck/custom.css"
          tppabs="http://www.zi-han.net/theme/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">

    <link href="css/plugins/fullcalendar/fullcalendar.css"
          tppabs="http://www.zi-han.net/theme/hplus/css/plugins/fullcalendar/fullcalendar.css" rel="stylesheet">
    <link href="css/plugins/fullcalendar/fullcalendar.print.css"
          tppabs="http://www.zi-han.net/theme/hplus/css/plugins/fullcalendar/fullcalendar.print.css" rel="stylesheet">

    <link href="css/animate.min.css" tppabs="http://www.zi-han.net/theme/hplus/css/animate.min.css"
          rel="stylesheet">
    <link href="css/style.min.css-v=4.0.0.css" tppabs="http://www.zi-han.net/theme/hplus/css/style.min.css?v=4.0.0"
          rel="stylesheet">
    <base target="_blank">
    <style>
        #zhuti{
            height:100%;

        }
        #zhuti::before{
            background:  url('img/logo1.png')  no-repeat fixed center;
            content:"";
            opacity:0.2;//透明度设置
        z-index:-1;
            width:2000px;
            height:1300px;
            position:absolute;
            /*top:0px;*/
            /*left:0px;*/
            /*border-radius:40px*/
        }
        #xiaohuiid{
            border-top: 0;
            padding-left: 20px;
            height:360px;
            background-color: #fff;
            margin-right: -15px;
            margin-left: -15px;
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row animated fadeInDown">

        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h4>会议预定状态图 </h4>
                </div>
                <div class="ibox-content">
                    <div id="calendar"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="js/jquery.min.js-v=2.1.4" tppabs="http://www.zi-han.net/theme/hplus/js/jquery.min.js?v=2.1.4">
</script>
<script src="js/bootstrap.min.js-v=3.3.5"
        tppabs="http://www.zi-han.net/theme/hplus/js/bootstrap.min.js?v=3.3.5"></script>
<script src="js/content.min.js-v=1.0.0" tppabs="http://www.zi-han.net/theme/hplus/js/content.min.js?v=1.0.0">
</script>
<!--<script src="js/jquery-ui.custom.min.js" tppabs="http://www.zi-han.net/theme/hplus/js/jquery-ui.custom.min.js">-->
<!--</script>-->
<script src="js/plugins/iCheck/icheck.min.js"
        tppabs="http://www.zi-han.net/theme/hplus/js/plugins/iCheck/icheck.min.js"></script>
<script src="js/plugins/fullcalendar/fullcalendar.min.js"
        tppabs="http://www.zi-han.net/theme/hplus/js/plugins/fullcalendar/fullcalendar.min.js"></script>
<script src="js/plugins/validate/jquery.validate.min.js"
        tppabs="http://www.zi-han.net/theme/hplus/js/plugins/validate/jquery.validate.min.js"></script>
<script src="js/plugins/validate/messages_zh.min.js"
        tppabs="http://www.zi-han.net/theme/hplus/js/plugins/validate/messages_zh.min.js"></script>
<script src="js/demo/form-validate-demo.min.js"
        tppabs="http://www.zi-han.net/theme/hplus/js/demo/form-validate-demo.min.js"></script>
<script>
    <!--    拆分时间字符串-->
    function stringToTime(str) {
        var date = str;
        date = date.substring(0, 19);
        date = date.replace(/-/g, '/');
        date = date.replace(/:/g, '/');
        date = date.replace(/\s/g, "/");
        var a = date.split('/');
        return a;
    };


    $(document).ready(function () {
        $("#calendar").fullCalendar({
            header: {
                left: "prev,next",
                center: "title",
                right: "month,agendaWeek,agendaDay"
            },
            editable: false,
            droppable: true,
            drop: function (g, h) {
                let f = $(this).data("eventObject");
                let d = $.extend({}, f);
                d.start = g;
                d.allDay = h;
                $("#calendar").fullCalendar("renderEvent", d, true);
                if ($("#drop-remove").is(":checked")) {
                    $(this).remove()
                }
            },
            events: function (start, end, callback) {
                $.ajax({
                    type: "POST",
                    url: "/user/findAfterToday",
                    success: function (list) {
                        let events = [];
                        console.log("list:", list);
                        for (let i = 0; i < list.length; i++) {
                            let st = stringToTime(list[i].starttime);
                            let et = [];
                            if (list[i].delaystate == "审批通过") {
                                et = stringToTime(list[i].delaytime);
                            } else {
                                et = stringToTime(list[i].endtime);
                            }
                            events.push({
                                title: list[i].name,
                                start: new Date(parseInt(st[0]), parseInt(st[1]) - 1, parseInt(st[2]), parseInt(st[3]), parseInt(st[4])),
                                allDay: false,
                                end: new Date(parseInt(et[0]), parseInt(et[1]) - 1, parseInt(et[2]), parseInt(et[3]), parseInt(et[4])),
                                url: ""
                            })
                        }
                        callback(events);
                    }
                });
            }
        })
    })
</script>
<script type="text/javascript" src="../../../tajs.qq.com/stats-sId=9051096"
        tppabs="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>

</html>
